#pragma once

#include "PresentParameters.h"
#include "DisplayMode.h"
#include "D3DCaps.h"
#include "D3DAdapterIdentifier.h"

namespace Vortex { namespace Wrapper { namespace Direct3D {

	ref class Direct3DDevice9;

	///<summary>Wrapper of IDirect3D9 API interface</summary>
	public ref class Direct3DLibrary9 {
		IDirect3D9* _handle;

	public:
		///<summary>Direct3D handle</summary>
		property IntPtr Handle { IntPtr get() { return IntPtr(_handle); } }

		Direct3DLibrary9();

		~Direct3DLibrary9();

		///<summary>Create Direct3D device with parameters</summary>
		HResult CreateDevice(int adapterOrdinal, D3DDeviceType type, IntPtr focusWindow, D3DDeviceCreateFlags flags, PresentParameters% presentParams, [Out] Direct3DDevice9^% device);

		///<summary>Number of adapters registered in system</summary>
		UINT GetAdapterCount();

		///<summary>Returns count of adapter modes</summary>
		UINT GetAdapterModeCount(UINT adapter, D3DFormat format);

		///<summary>Check can device use this enumerate adapter mode</summary>
		HResult EnumAdapterModes(UINT adapter, D3DFormat format, UINT mode, [Out] DisplayMode% displayMode);

		HResult GetDeviceCaps(UINT Adapter, [Out] D3DCaps% caps);	

		HResult GetAdapterIdentifier(UINT Adapter, [Out] D3DAdapterIdentifier% adapteri);
	};

} } }